package com.ks;

import com.ks.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@SpringBootApplication
@RestController
@RequestMapping("/")
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class,args);
    }

    @Autowired
    private StudentService studentService;

    @RequestMapping("/test1")
    public String test1(@RequestParam String name){
        studentService.addStudent1("1-"+name);
        return "test1，ok,,,"+new Date();
    }
    @RequestMapping("/test2")
    public String test2(@RequestParam String name){
        studentService.addStudent2("2-"+name);
        return "test2，ok,,,"+new Date();
    }
    @RequestMapping("/test3")
    public String test3(@RequestParam String name){
        studentService.addStudent3("3-"+name);
        return "test3，ok,,,"+new Date();
    }
    @RequestMapping("/test4")
    public String test4(@RequestParam String name){
        studentService.addStudent4("4-"+name);
        return "test4，ok,,,"+new Date();
    }
    @RequestMapping("/test5")
    public String test5(@RequestParam String name){
        studentService.addStudent5("5-"+name);
        return "test5，ok,,,"+new Date();
    }
    @RequestMapping("/test6")
    public String test6(@RequestParam String name){
        studentService.addStudent6("6-"+name);
        return "test6，ok,,,"+new Date();
    }
}
